gvc_mixer_stream_get_port() emits a warning in the no-ports case,
which we can avoid by rearranging the check for that case.
https://bugzilla.gnome.org/show_bug.cgi?id=693049
// a bit hackish, but ALSA/PulseAudio have a number
// of different identifiers for headphones, and I could
// not find the complete list
- let port = sink.get_port();
- if (port)
- return port.port.indexOf('headphone') >= 0;
+ if (sink.get_ports().length > 0)
+ return sink.get_port().port.indexOf('headphone') >= 0;
return false;
},